<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>MyJPetStore</title>
    <link rel="StyleSheet" href="../css/jpetstore.css" type="text/css" media="screen"/>
</head>
<body>
<header th:replace="common/top"></header>

<div id="Content">
    <div id="BackLink">
        <a th:href="/cart/viewCart">Return to Shopping Cart</a>
    </div>

    <div id="Catalog">

        <table>
            <tr>
                <td>
                    <h2>Checkout Summary</h2>

                    <table>

                        <tr>
                            <td><b>Item ID</b></td>
                            <td><b>Product ID</b></td>
                            <td><b>Description</b></td>
                            <td><b>In Stock?</b></td>
                            <td><b>Quantity</b></td>
                            <td><b>List Price</b></td>
                            <td><b>Total Cost</b></td>
                        </tr>
                        <tr th:each="cartItem:${cart.cartItems}">
                            <td>
                                <a th:href="'/catalog/viewItem?itemId=' + ${cartItem.item.itemId}"
                                   th:text="${cartItem.item.itemId}">Item ID</a>
                            </td>
                            <td th:text="${cartItem.item.product.productId}"></td>
                            <td th:text="${cartItem.item.attribute1} + ${cartItem.item.product.name}"></td>
                            <td th:text="${cartItem.inStock}"></td>
                            <td th:text="${cartItem.quantity}"></td>
                            <td th:text="${#numbers(${cartItem.item.listPrice},1,2)}"></td>
                            <td th:text="${#numbers(${cartItem.total},1,2)}"></td>
                        </tr>
                        <tr>
                            <td colspan="7">Sub Total:
                                <label th:text="${#numbers(${cart.subTotal},1,2)}"></label>
                        </tr>

                    </table>

                <td>&nbsp;</td>

            </tr>
        </table>

    </div>
</div>

<footer th:replace="common/bottom"></footer>

</body>
</html>